﻿{% extends "base.html" %}

{% load smart_if %}


{% block title %}Izpis predmetnika{% endblock %}

{% block content %}

<div class="module2" id="searchlist">
<table cellspacing="0"> 
<th width="200"><a>Izpis predmetnika</a></th><th style="text-align: right;">
{% if not print_view %}<span align="right" class="paginator"><a href="?print=1" target="_blank">Natisni</a></span>{% endif %}
</th>

<tr class="{% cycle 'row1' 'row2' %}">
	<td><b>Šolsko leto</b></td>
	<td> {{ school_year }}</td>
</tr>

<tr class="{% cycle 'row1' 'row2' %}">
	<td><b>Študijski program</b></td>
	<td>{{ program.name }}</td>
</tr>

</tr>
</table>
</div>


{% for year in program.years %}
<div class="module2" id="searchlist">
<table cellspacing="0"> 
<th colspan="2" class="sorted {{ order_asc|yesno:'ascending,descending' }}">
      <a>{{ year.name }}</a>
</th>
{% for module in year.modules %}
{% if module.required %} 
<tr class="row3">
	<td width="30%" class="modulename"><b>{{module.name}}</b></td>
	<td>
		<div class="module" id="searchlist">
		<table cellspacing="0"> 			
			<thead>
				<th width="50%"><b>Predmet</b></th>
				<th><b>Predavatelji</b></th>
			</thead>				
		{% for subject in module.subjects %}
			<tr class="{% cycle 'row1' 'row2' %}">
			<td>{{subject.name}}</td>
				<td>
				  {% for lecturer in subject.lecturers %}
					{% if forloop.last %} {{ lecturer|title }} {% else %} {{ lecturer|title }},  {% endif %}		
				  {% endfor %}			
				</td>				
			</tr>
		{% endfor %}
		</table>
		</div>
	</td>

</tr>
{% endif %}
{% endfor %}

{% if year.electives %}
<tr class="row3">
	<td width="30%" class="modulename"><b>PROSTO IZBIRNI PREDMETI</b></td>
	<td>
		<div class="module" id="searchlist">
		<table cellspacing="0"> 			
			<thead>
				<th width="50%"><b>Predmet</b></th>
				<th><b>Predavatelji</b></th>
			</thead>				
		{% for subject in year.electives %}
			<tr class="{% cycle 'row1' 'row2' %}">
			<td>{{subject.name}}</td>
				<td>
				  {% for lecturer in subject.lecturers %}
					{% if forloop.last %} {{ lecturer|title }} {% else %} {{ lecturer|title }},  {% endif %}		
				  {% endfor %}			
				</td>				
			</tr>
		{% endfor %}
		</table>
		</div>
	</td>
</tr>
{% endif %}

{% for module in year.modules %}
{% if not module.required %} 
<tr class="{% cycle 'row1' 'row2' %}">
	<td width="30%" class="modulename">{{module.name}}</td>
	<td>
		<div class="module" id="searchlist">
		<table cellspacing="0"> 			
			<thead>
				<th width="50%"><b>Predmet</b></th>
				<th><b>Predavatelji</b></th>
			</thead>				
		{% for subject in module.subjects %}
			<tr class="{% cycle 'row1' 'row2' %}">
			<td>{{subject.name}}</td>
				<td>
				  {% for lecturer in subject.lecturers %}
					{% if forloop.last %} {{ lecturer|title }} {% else %} {{ lecturer|title }},  {% endif %}		
				  {% endfor %}			
				</td>				
			</tr>
		{% endfor %}
		</table>
		</div>
	</td>

</tr>
{% endif %}
{% endfor %}
</table>
</div>
{%endfor%}

{% endblock %}